<div class="dux-page-header uk-clearfix">
    <div class="page-title">
        <a class="uk-button uk-button-primary" href="{url('index', ['class_id' => $classId])}"> 文章列表</a>
    </div>
    <div class="page-action">
        <a class="uk-button uk-button-danger" href="javascript:location.reload();"><i class="fa fa-refresh"></i></a>
    </div>
</div>

<form class="dux-form uk-form  uk-form-stacked " data-dux="form-bind" method="post">
    <div class="uk-grid">
        <div class="uk-width-2-3@l">
            <div class="uk-card uk-card-small uk-card-default dux-panel">

                <div class="uk-card-header">{$assignName}文章</div>
                <div class="uk-card-body">
                    <fieldset>
                        <div class="dux-flex-layout">
                            <div class="flex-auto">
                                <div class="uk-form-group">
                                    <label class="uk-form-label">文章分类</label>
                                    <div>
                                        <select data-dux="form-select" name="class_id" required>
                                            <!--loop{(array)$classList as $vo}-->
                                            <option <!--if{$vo.class_id == $classId}--> selected <!--{/if}-->
                                            value="{$vo.class_id}">{$vo.cname}</option>
                                            <!--{/loop}-->
                                        </select>
                                    </div>
                                </div>
                                <div class="uk-form-group">
                                    <label class="uk-form-label">文章标题</label>
                                    <div>
                                        <input type="text" name="title" value="{$info.title}" placeholder="请输入文章标题"
                                               required>
                                    </div>
                                </div>


                            </div>
                            <div style="width: 170px; padding-top: 25px;" class="uk-text-right">
                                <div class="uk-inline-clip uk-transition-toggle uk-light" tabindex="0">
                                    <img src="{$info.image ? $info.image : url('controller/tools/Placeholder/index', ['width' => 150, 'height' => 125])}" width="150" height="125" id="image-pic" >
                                    <div class="uk-position-center">
                                        <a href="javascript:;" ><span data-dux="form-upload" data-target="#image" data-type="jpg,png,bmp" data-preview="#image-pic" class="uk-transition-fade" uk-marker></span></a>
                                    </div>
                                </div>
                                <input type="hidden"  name="image" id="image" value="{$info.image}">
                            </div>
                        </div>


                        <div class="uk-form-group">
                            <label class="uk-form-label">推荐位</label>
                            <div>
                                <?php $posIds = explode(',', $info['pos_id']); ?>
                                <select name="pos_id[]" multiple data-dux="form-select" data-placeholder="选择推荐位">
                                    <!--loop{$posList as $vo}-->
                                    <option value="{$vo.pos_id}" <!--if{in_array($vo.pos_id, $posIds)}--> selected <!--{/if}-->>{$vo.name}</option>
                                    <!--{/loop}-->
                                </select>
                            </div>
                        </div>

                        {$filterHtml}

                        <div class="uk-form-group">
                            <label class="uk-form-label">正文内容</label>
                            <div>
                                <textarea data-dux="form-editor" name="content" style="height: 400px">{$info.content}</textarea>
                            </div>
                        </div>

                        {$modelHtml}

                        <div class="uk-form-group">
                            <label class="uk-form-label">关键词</label>
                            <div>
                                <input type="text" name="keyword" value="{$info.keyword}" data-dux="form-tags" placeholder="可选,文章关键词">
                            </div>
                        </div>
                        <div class="uk-form-group">
                            <label class="uk-form-label">文章描述</label>
                            <div>
                                <textarea name="description" placeholder="可选,文章描述">{$info.description}</textarea>
                            </div>
                        </div>
                        <input type="hidden" name="article_id" value="{$info.article_id}">
                        <button class="uk-button uk-button-primary" type="submit" disabled>保存</button>

                    </fieldset>
                </div>
            </div>
        </div>
        <div class="uk-width-1-3@l">
            <div class="uk-card uk-card-small uk-card-default dux-panel">

                <div class="uk-card-header">可选信息</div>
                <div class="uk-card-body">
                    <fieldset>
                        <div class="uk-form-group">
                            <label class="uk-form-label">副标题</label>
                            <div>
                                <input type="text" name="subtitle" value="{$info.subtitle}" placeholder="请输入副标题名称">
                            </div>
                        </div>

                        <div class="uk-form-group">
                            <label class="uk-form-label">发布时间</label>
                            <div>
                                <input type="text" data-dux="form-date"  data-type="datetime" readonly name="create_time" value="{$info.create_time ? date('Y-m-d H:i:s', $info.create_time) : date('Y-m-d H:i:s')}" placeholder="文章发布时间">
                            </div>
                        </div>

                        <div class="uk-form-group">
                            <label class="uk-form-label">文章顺序</label>
                            <div>
                                <input type="text" name="sort" value="{$info.sort ? $info.sort : 0}" placeholder="链接排序,按照从小->大排序列表">
                            </div>
                        </div>


                        <div class="uk-form-group">
                            <label class="uk-form-label">外部链接</label>
                            <div>
                                <input type="text" name="url" value="{$info.url}" placeholder="请输入链接地址">
                            </div>
                        </div>

                        <div class="uk-form-group">
                            <label class="uk-form-label">模板名称</label>
                            <div class="uk-input-group">
                                <span class="uk-input-group-label">article_</span>
                                <input class="uk-form-field" type="text" name="tpl" value="{$info.tpl}" placeholder="指定固定模板">
                                <span class="uk-input-group-label">.html</span>
                            </div>
                        </div>

                        <div class="uk-form-group">
                            <label class="uk-form-label">浏览量</label>
                            <div>
                                <input type="number" name="view" value="{$info.view}" placeholder="文章浏览次数">
                            </div>
                        </div>

                        <div class="uk-form-group">
                            <label class="uk-form-label">来源</label>
                            <div>
                                <input type="text" name="source" value="{$info.source}" placeholder="文章来源">
                            </div>
                        </div>

                        <div class="uk-form-group">
                            <label class="uk-form-label">作者</label>
                            <div>
                                <input type="text" name="auth" value="{$info.auth}" placeholder="文章作者">
                            </div>
                        </div>

                        <div class="uk-form-group">
                            <label class="uk-form-label">编辑</label>
                            <div>
                                <input type="text" name="editor" value="{$info.editor}" placeholder="文章编辑">
                            </div>
                        </div>

                        <div class="uk-form-group">
                            <label class="uk-form-label">文章状态</label>
                            <div class="uk-grid">
                                <?php $info['status'] = isset($info['status']) ? $info['status'] : 1;  ?><div class="uk-grid">
                                <label>
                                    <!--if{$info['status']}-->
                                    <input name="status" value="1" checked="checked" type="radio"  class="uk-radio" >
                                    <!--{else}-->
                                    <input name="status" value="1" type="radio"  class="uk-radio" >
                                    <!--{/if}-->
                                    正常
                                </label>
                                <label>
                                    <!--if{!$info['status']}-->
                                    <input name="status" checked="checked" value="0" type="radio"  class="uk-radio" >
                                    <!--{else}-->
                                    <input name="status" value="0" type="radio"  class="uk-radio" >
                                    <!--{/if}-->
                                    隐藏
                                </label>
                            </div></div>
                        </div>
                    </fieldset>
                </div>
            </div>
        </div>
    </div>

</form>
